﻿@using MrCMS.Helpers
@model MrCMS.Entities.Messaging.MessageTemplate
@{
    ViewBag.Title = "Add Message Template";
}

@using (Html.BeginForm("Add", "MessageTemplate", FormMethod.Post, new { id = "edit-message-template" }))
{
    <fieldset>
        <legend>
            @Resource("Add") @Model.GetType().Name.BreakUpString()
            <span class="pull-right btn-group">
                @Html.ActionLink(Resource("Back"), "Index", "MessageTemplate", null, new { @class = "btn" })
                <input class="btn btn-primary" type="submit" value="@Resource("Save")" /> 
            </span>
        </legend>
        @Html.HiddenFor(x => x.MessageTemplateType)
        <div class="row">
            <div class="col-lg-6">
                <div class="form-group">
                    @Html.LabelFor(x => x.FromAddress)
                    @Html.TextBoxFor(x => x.FromAddress, new { @class = "form-control" })
                    @Html.ValidationMessageFor(x => x.FromAddress)
                </div>
                <div class="form-group">
                    @Html.LabelFor(x => x.FromName)
                    @Html.TextBoxFor(x => x.FromName, new { @class = "form-control" })
                    @Html.ValidationMessageFor(x => x.FromName)
                </div>
                <div class="form-group">
                    @Html.LabelFor(x => x.Cc)
                    @Html.TextBoxFor(x => x.Cc, new { @class = "form-control" })
                    @Html.ValidationMessageFor(x => x.Cc)
                </div>
            </div>
            <div class="col-lg-6">
                <div class="form-group">
                    @Html.LabelFor(x => x.ToAddress)
                    @Html.TextBoxFor(x => x.ToAddress, new { @class = "form-control" })
                    @Html.ValidationMessageFor(x => x.ToAddress)
                </div>
                <div class="form-group">
                    @Html.LabelFor(x => x.ToName)
                    @Html.TextBoxFor(x => x.ToName, new { @class = "form-control" })
                    @Html.ValidationMessageFor(x => x.ToName)
                </div>
                <div class="form-group">
                    @Html.LabelFor(x => x.Bcc)
                    @Html.TextBoxFor(x => x.Bcc, new { @class = "form-control" })
                    @Html.ValidationMessageFor(x => x.Bcc)
                </div>
            </div>
        </div>
       
        <div class="row">
            <div class="col-lg-12">
                <div class="form-group">
                    @Html.LabelFor(x => x.Subject)
                    @Html.TextBoxFor(x => x.Subject, new { @class = "form-control" })
                    @Html.ValidationMessageFor(x => x.Subject)
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-lg-12">
                <div class="form-group">
                    @Html.LabelFor(x => x.Body)
                    @Html.TextAreaFor(x => x.Body, new { @class = (Model.IsHtml ? "ckedit-enabled form-control" : "form-control"), style = "min-height:200px;" })
                    @Html.ValidationMessageFor(x => x.Body)
                </div>
            </div>
        </div>

        <br/>
        
        @Html.InlineCheckboxFor(x => x.IsHtml)

    </fieldset>
}
@{ Html.IncludeScript("~/Areas/Admin/Content/Scripts/mrcms/edit-message-template.js");}